package src;

public class 数组遍历 {
    public static void main(String[] args) {
        int[] array1 = {1,2,3,4,5};
        //遍历数组
        for (int i = 0; i < array1.length; i++) {
            System.out.print(array1[i] +" ");
        }
        System.out.println();

        int i = 0;
        while ( i <array1.length){
            System.out.print(array1[i] +" ");
            i++;
        }
        System.out.println();


        for (int x:array1){
            System.out.print(x +" ");
        }
    }
}
